/**
 * PagePropertyHeader
 */

import React, {Component} from 'react';
import { connect } from 'dva';
import { bindActionCreators } from 'redux';
import FocusTab from "../../../consts/focusTabs";
import editorActions from '../../../actions/Editor/editor';
class PagePropertyHeader extends Component{
    render(){
        const {focusTab,setState} = this.props;
        return (
            <header className="header">
                <div onClick={() => setState({focusTab:FocusTab.PAGE})} className={"sidebar-tab-btn " + (focusTab == FocusTab.PAGE ? "focus" : "")}>页面</div>
                <div onClick={() => setState({focusTab:FocusTab.H5AR})} className={"sidebar-tab-btn " + (focusTab == FocusTab.H5AR ? "focus" : "")}>H5AR</div>
                <div onClick={() => setState({focusTab:FocusTab.SHARE})} className={"sidebar-tab-btn " + (focusTab == FocusTab.SHARE ? "focus" : "")}>分享</div>
            </header>
        )
    }
 }

 const mapStateToProps = ({ editor }) => {
  return editor;
};

const mapDispatchToProps = (dispatch) => {
  return bindActionCreators(editorActions, dispatch);
};


export default connect(mapStateToProps, mapDispatchToProps)(PagePropertyHeader);
